home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / misc / a8085.lha / A8085 V1.0 / A8085.doc < prev    next >
Text File  |  1995-07-31  |  11KB  |  294 lines

  1.                         ___   ___   ___   ___  _____
  2.                        / _ \ / _ \ / _ \ / _ \| ____|
  3.                       | |_| | (_) | | | | (_) | |__
  4.                       |  _  |> _ <| | | |> _ <|___ \
  5.                       | | | | (_) | |_| | (_) |___) |
  6.                       |_| |_|\___/ \___/ \___/|____/ V1.0
  7.  
  8.                         © 1994-95 by Frank Würkner
  9.                             All Rights Reserved
  10.  
  11.  
  12.  
  13. COPYRIGHT NOTE
  14. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  15. The program A8085 is copyrighted © 1994-95 by Frank Würkner.
  16. All rights reserved.
  17.  
  18. A8085 is FREEWARE.  This program may be freely distributed as long as
  19.   - the executable and documentation remain unchanged and
  20.     are included in the distribution
  21.   - No other charge is made than to cover time and copying costs
  22.  
  23.  
  24. DISCLAIMER
  25. ¯¯¯¯¯¯¯¯¯¯
  26. No warranties of any kind are made as to the functionality of this
  27. program. You are using it ENTIRE at your own risk.
  28.  
  29.  
  30. SYSTEM REQUIREMENTS
  31. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  32. You'll need OS2.0 or higher !!!
  33.  
  34.  
  35. WHAT IS IT
  36. ¯¯¯¯¯¯¯¯¯¯
  37. Why emulate a 8bit 8085 CPU you may ask ???
  38. The 8085 is often used to teach beginners the basics about processors. But
  39. often you are forced to use antique computer equipment where you have to
  40. enter the code as hex numbers. Or even worst you are only thought in an
  41. abstract way without ever seeing how or if the programs you write work.
  42. That's where A8085 comes in. But you can also learn some basic things
  43. about computers (stack, internal processor flags, ...). And the best:
  44. The computer doesn't guru if your program is wrong!
  45.  
  46.  
  47. FEATURES
  48. ¯¯¯¯¯¯¯¯
  49. + emulator/assembler/disassembler support all 246 instructions of the 8085,
  50.   even those 10 illegal commands :-)
  51. + execute single instructions by simply typing them in the command line
  52. + emulator counts the cycles the real 8085 would have needed
  53. + any number of breakpoints
  54. + import/export data from/to the 8085 memory
  55. + powerfull expression calculator
  56. + often used command sequences can be put into macro files
  57. + comes with a mini kernal including most needed functions (divide, multiply,
  58.   print, print number, ...)
  59.  
  60. - interrupts and serial I/O are not part of the emulation
  61. - all I/O commands (i.e. OUT and IN) are only mapped to the terminal window
  62. - the emulation is quite slow, assembling is even slower
  63.  
  64.  
  65. USAGE
  66. ¯¯¯¯¯
  67. A8085 can be started in the CLI or via the supplied startup icon.
  68. When started via CLI you can supply one macrofile, that should be executed
  69. at startup.
  70. The program uses following directory structure that can not be changed. all
  71. those drawers must be present in the current directory:
  72.  
  73. drawer | extension | description
  74. -------+-----------+--------------------------------------------------
  75.  SRC/  |    .a     | assembler source files
  76.  INC/  |    .i     | includefiles (currently only Kernal.i)
  77.  PRG/  |    .p     | program files created by assembling source files
  78.  MAC/  |    .m     | macrofiles
  79.  
  80. At startup A8085 reads the file PRG/Kernal.p into memory which is the
  81. current kernal.
  82.  
  83. A8085 understands the following commands:
  84.  
  85. o ASSEMBLE (short AS) file.a[,v,w]
  86.   The 8085 mnonics in the SRC/file are assembled into memory. If you use the
  87.   `,v' switch the assembled commands are also printed to the window. If you
  88.   use `,w' switch the code is also written to the PRG/file.p. The programm
  89.   file also includes the state of all registers (including PC which is set to
  90.   the label `start', or to the begin of your program if not present).
  91.   All commands described in 8085.doc are understood. You can define lables
  92.   by putting a `<labelname>:' at the beginning of the line. Each line can only
  93.   contain one command! There are also some pseudo commands that are helpfull:
  94.  
  95.   o ILL <$10,$08,$18,$28,$38,$CB,$D9,$DD,$ED,$FD>
  96.     These are the 10 bytes of the 8085 that do not represent a 8085 command.
  97.     While you may see them when disassembling text or data, you shouldn't
  98.     need them for assembling because the next to pseudo commands are much
  99.     easier to use.
  100.  
  101.   o DC.B [bytes],["text"]
  102.     Assemble data bytes and/or text into programm.
  103.     Example `DC.B "this is text!",0,"even more",0'
  104.  
  105.   o DC.W [words]
  106.     Assemble words into programm (one word is made of two bytes).
  107.     Example `DC.W $ffff,15478,0,%1110010001111110'
  108.  
  109.   o ORG address
  110.     Define memory address where following code should be put to.
  111.  
  112.   o EQU label = number
  113.     Define a label with any number/address.
  114.  
  115.   o INC file.i
  116.     Include the file INC/file.i into the program. The commands there will be
  117.     interpreted as if they stood in the program text itself.
  118.     Example: To use the kernal functions `inc Kernal.i'
  119.  
  120. o DISASSEMBLE (short DIS) start[,end]
  121.   Disassemble memory from start (to end). You can stop the output with CTRL-C.
  122.  
  123. o MEMORY (short M) start[,end]
  124.   Show content of memory from start (to end). You can stop the output with
  125.   CTRL-C.
  126.  
  127. o GO [address]
  128.   Start emulating a 8085 at address (if ommitted start where the program
  129.   counter points to). The emulation can be stopped by pressing CTRL-C.
  130.   Otherwise it will stop at HLT commands as well as illegal commands.
  131.   If you have set breakpoints, it will also stop there! At the end it will
  132.   show you the state of all internal registers and processor flags (see
  133.   STATUS command).
  134.  
  135. o STATUS (short ST)
  136.   Show state of internal registers (in hexadecimal numbers) and processor
  137.   flags, e.g
  138.  
  139.   program     stack       accumulator   parity flag
  140.   counter     pointer     |            /  zero flag
  141.   |           |           |           |   |
  142.   PC: 1023    SP: 1000    A : 49    C-P-A-Z-S <- sign flag
  143.   BC: 0000    DE: 0000    HL: 1000  1 1 0 1 0
  144.   |           |           |         |   |
  145.   |           DE register |          \  auxiliary carry flag
  146.   |           pair        HL register \
  147.   BC register             pair         carry flag
  148.   pair
  149.  
  150.   [emulated 1851 cycles]
  151.              |
  152.              processor cycles that a real
  153.              8085 would have needed
  154.  
  155. o LOAD (short LD) file.p
  156.   Load the program PRG/file.p into memory and set all internal registers.
  157.  
  158. o RUN file.p
  159.   Load PRG/file.p (see above) and start emulation.
  160.  
  161. o IMPORT (short I) file,start[,len]
  162.   Import data to 8085 memory form file to memory address start (len bytes
  163.   long).
  164.  
  165. o EXPORT (short E) file,start[,len]
  166.   Export data from 8085 memory form memory address start to file (len bytes
  167.   long).
  168.  
  169. o CALC (short C) expression
  170.   Calculate expression and show result as real, decimal, hexadecimal
  171.   and binary.
  172.   Examples:
  173.   `sin(pi)-cos(rad(90)-pi)'   -> 6.97573699601729E-16 [8bit: 0 $00 %00000000]
  174.   `5!-1*2*3*4*5'              -> 1.13686837721616E-13 [8bit: 0 $00 %00000000]
  175.   `(7=8) xor true'            -> -1 [16bit: 65535 $FFFF %1111111111111111]
  176.   `1000 mod 7'                -> 6 [8bit: 6 $06 %00000110]
  177.   `(&377+$ff+%11111111)/3'    -> 255 [8bit: 255 $FF %11111111]
  178.  
  179. o SETBREAKPOINT (short BP) [address]
  180.   Set a breakpoint at address. If address is omitted: show all current
  181.   breakpoints.
  182.  
  183. o CLEARBREAKPOINT (short CBP) nr
  184.   Clear breakpoint with number nr (use BP to find number!).
  185.  
  186. o ECHO string
  187.   Print string to window (for macros).
  188.  
  189. o WAIT
  190.   Wait for <RETURN> to be pushed (for macros).
  191.  
  192. o macroname
  193.   Executes the commands in MAC/macroname.m.
  194.   Currently only the macro `ed' is available. You can comfortable edit the
  195.   8085 memory (you need to have aminet/disk/moni/Zap247.lha installed in
  196.   your c: directory).
  197.  
  198. o register(pair)=expression
  199.   Set the a register or registerpair to a value, e.g. `PC=$1000'.
  200.   Shows STATUS afterwards.
  201.  
  202. o 8085-mnemo ?|args
  203.   This is one of the most powerfull possibilties!
  204.  
  205.   Show arguments to a 8085 menmonic, e.g. `PUSH ?' will give
  206.   'PUSH  <BC,DE,HL>
  207.    PUSH  PSW'
  208.  
  209.   Even better: Execute 8085 command by simply entering the 8085 menmonic
  210.   plus arguments and immediate see what effect it has to the internal
  211.   registers and flags, e.g. `PUSH BC' (have a look at the stack pointer and
  212.   where it points to!)
  213.  
  214. o !CLI-command
  215.   Execute the CLI command.
  216.  
  217. o QUIT (short Q)
  218.   Quit A8085.
  219.  
  220. o HELP (short H)
  221.   Display a short help page
  222.  
  223.  
  224.  
  225. EXAMPLE SESSION
  226. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  227. double click `Start A8085'
  228. take a look at SRC/BubbleSort.a
  229. > as BubbleSort.a                            [assemble BubbleSort into memory]
  230. *** Pass 1
  231. *** Pass 2
  232. code from $1000 to $103E (start at $101E)
  233. > dis start,$103E                            [let's have a look at the code]
  234. 101E: 21 00 10         LXI  HL,$1000
  235. 1021: 06 1D            MVI  B,$1D
  236. 1023: 0E 00            MVI  C,$00
  237. 1025: 56               MOV  D,M
  238. 1026: 23               INX  HL
  239. 1027: 7E               MOV  A,M
  240. 1028: BA               CMP  D
  241. 1029: D2 33 10         JNC  $1033
  242. 102C: 0E 01            MVI  C,$01
  243. 102E: 2B               DCX  HL
  244. 102F: 77               MOV  M,A
  245. 1030: 23               INX  HL
  246. 1031: 72               MOV  M,D
  247. 1032: 7A               MOV  A,D
  248. 1033: 57               MOV  D,A
  249. 1034: 05               DCR  B
  250. 1035: C2 26 10         JNZ  $1026
  251. 1038: 79               MOV  A,C
  252. 1039: FE 01            CPI  $01
  253. 103B: CA 1E 10         JZ   $101E
  254. 103E: 76               HLT  
  255. > m btab,etab                                [now at the table we want to sort]
  256. 1000: 0D 03 07 0C 02 09 01 0A 04 2D 17 0C 36 38 C6  `·········-··68Æ'
  257. 100F: 2B C8 22 0B 6F 16 36 7A D3 F5 FF 2C FA A6 05  `+È"·o·6zÓõÿ,ú¦·'
  258. > bp $103B                                   [let's have a breakpoint at the
  259. > bp                                          first round!]
  260. Breakpoint #1 : $103B
  261. > go                                         [start emulation]
  262. *** Breakpoint at $103B
  263. PC: 103B    SP: 1000    A : 01    C-P-A-Z-S
  264. BC: 0001    DE: FF00    HL: 101D  0 1 0 1 0
  265. [emulated 2058 cycles]
  266. > m btab,etab                                [do you see our bubbles go up?]
  267. 1000: 03 07 0C 02 09 01 0A 04 0D 17 0C 2D 36 38 2B  `···········-68+'
  268. 100F: C6 22 0B 6F 16 36 7A C8 D3 F5 2C FA A6 05 FF  `Æ"·o·6zÈÓõ,ú¦·ÿ'
  269. > cbp 1                                      [now clear our breakpoint]
  270. > go                                         [and resume emulation]
  271. *** HLT command
  272. PC: 103E    SP: 1000    A : 00    C-P-A-Z-S
  273. BC: 0000    DE: FF00    HL: 101D  1 1 1 0 1
  274. [emulated 36786 cycles]
  275. > m btab,etab                                [have a look at our sorted table]
  276. 1000: 01 02 03 04 05 07 09 0A 0B 0C 0C 0D 16 17 22  `··············"'
  277. 100F: 2B 2C 2D 36 36 38 6F 7A A6 C6 C8 D3 F5 FA FF  `+,-668oz¦ÆÈÓõúÿ'
  278. > q                                          [that's it folks!]
  279.  
  280.  
  281.  
  282.  
  283. If you have comments, suggestions, criticism, bug reports etc.
  284. send mail to
  285.  
  286.                 Frank Würkner
  287.                 Georgenschwaigstr. 22
  288.                 D-80807 München
  289.                 Germany
  290.  
  291.                 or
  292.  
  293.                 E-Mail: wuerkner@informatik.tu-muenchen.de
  294.